Telegram Group & Telegram Channel
3. Determining variable type with type()

>> a=7
>>> type(a)
<class 'int'>

>>> b=7.7
>>> type(b)
<class 'float'>

>>> c="hello"
>>> type(c)
<class 'str'>

>>> d=[1,2,3]
>>> type(d)
<class 'list'>

>>> e=(1,2,3)
>>> type(e)
<class 'tuple'>

>>> f={1:"one",2:"two"}
>>> type(f)
<class 'dict'>

>>> g={1,2,3}
>>> type(g)
<class 'set'>

>>> i=True
>>> type(i)
<class 'bool'>





You can check what type of object is assigned to a variable using Python's built-in type() function. Common data types include:

int (for integer)
float
str (for string)
list
tuple
dict (for dictionary)
set
bool (for Boolean True/False)

@python_codes



tg-me.com/python_codes/6
Create:
Last Update:

3. Determining variable type with type()

>> a=7
>>> type(a)
<class 'int'>

>>> b=7.7
>>> type(b)
<class 'float'>

>>> c="hello"
>>> type(c)
<class 'str'>

>>> d=[1,2,3]
>>> type(d)
<class 'list'>

>>> e=(1,2,3)
>>> type(e)
<class 'tuple'>

>>> f={1:"one",2:"two"}
>>> type(f)
<class 'dict'>

>>> g={1,2,3}
>>> type(g)
<class 'set'>

>>> i=True
>>> type(i)
<class 'bool'>





You can check what type of object is assigned to a variable using Python's built-in type() function. Common data types include:

int (for integer)
float
str (for string)
list
tuple
dict (for dictionary)
set
bool (for Boolean True/False)

@python_codes

BY Python Codes


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/python_codes/6

View MORE
Open in Telegram


Python Codes Telegram | DID YOU KNOW?

Date: |

That growth environment will include rising inflation and interest rates. Those upward shifts naturally accompany healthy growth periods as the demand for resources, products and services rise. Importantly, the Federal Reserve has laid out the rationale for not interfering with that natural growth transition.It's not exactly a fad, but there is a widespread willingness to pay up for a growth story. Classic fundamental analysis takes a back seat. Even negative earnings are ignored. In fact, positive earnings seem to be a limiting measure, producing the question, "Is that all you've got?" The preference is a vision of untold riches when the exciting story plays out as expected.

The seemingly negative pandemic effects and resource/product shortages are encouraging and allowing organizations to innovate and change.The news of cash-rich organizations getting ready for the post-Covid growth economy is a sign of more than capital spending plans. Cash provides a cushion for risk-taking and a tool for growth.

Python Codes from hk


Telegram Python Codes
FROM USA